/**
 * 
 * Author：liaozhanggen
 * Create Date：2017年3月2日
 * Version：v2.0
 */
package com.choosefine.it.payment.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.choosefine.it.base.BaseController;
import com.choosefine.it.common.def.CommonConstant;
import com.choosefine.it.common.def.ResultCode;
import com.choosefine.it.common.exception.BusinessException;
import com.choosefine.it.payment.service.WorkerSalaryPaymentService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 *  工人薪资支付控制台处理
 *  
 * Author：liaozhanggen
 * Create Date：2017年3月2日
 * Version：v2.0
 */
@Api(value="工人-收款-计算")
@RestController
@RequestMapping("/workerSalary")
public class WorkerSalaryPaymentController extends BaseController {

	@Autowired
	WorkerSalaryPaymentService workSalaryPaymentService;

    /**
     * 查询出班组下的成员应收及已收情况
     * @throws BusinessException 
     *
     * @Author：liaozhanggen
     * @Create Date：2017年3月2日
     * @param：....
     * @return：String
     */
    @ApiOperation(value="班组下工人成员未付薪资计算",notes="廖仉根")
    @RequestMapping(value="/members/{teamId}",method=RequestMethod.GET)
    public String findTeamMemberSalaryByTeamId(@PathVariable(name="teamId",required=true)int teamId) throws BusinessException{
    	if (teamId <= 0) {
			throw new BusinessException(ResultCode.FAILED,CommonConstant.PARAMETER_ERROR);
		}
    	
    	return responseSuccess(workSalaryPaymentService.findTeamMemberSalaryByTeamId(teamId));
    }
}
